package com.huangfu.easysardine.gate.controller;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created with IntelliJ IDEA.
 * User: huangfu.daohui
 * Date: 2017-7-31
 * Time: 16:38
 * Description:跳转到登录页面
 */
@Controller
public class SecurityController {
    
    @RequestMapping(value = "/login", method = RequestMethod.GET)
    //添加断路器
    @HystrixCommand(fallbackMethod = "loginError")
    public String login() {
        return "login";
    }

    public String loginError() {
        return "sorry,login error!";
    }
}
